const router = require('express').Router();
const mongoose = require('mongoose');
const DictionaryModel = mongoose.models['Dictionary'];
const WorkerModel = mongoose.models['Worker'];

router.get('/list', async function (req, res, next) {
    try{
        let page=parseInt(req.query.page);
        let rows=parseInt(req.query.rows)
        let dataList=await WorkerModel.find({}).skip((page-1)*rows).limit(rows);
        res.data(dataList);
    }catch(e){
        next(e.message);
    }
});


module.exports = router;